/*****************************************************************************
Copyright 2006 Kervin L. Pierre
    EMAIL: otlkcon@adevsoft.com

This file is part of Otlkcon.

Otlkcon is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

Otlkcon is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Lesser GNU General Public License for more details.

You should have received a copy of the Lesser GNU General Public License
along with Otlkcon; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

*******************************************************************************/


#ifndef OTLKCON_PRINT_H
#define OTLKCON_PRINT_H

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h>

#include <otlkcon_config.h>

extern wchar_t otlkcon_logFile[MAX_PATH+1];
extern int  otlkcon_logToFileEnabled;
extern int  otlkcon_logToSMEnabled;
extern int  otlkcon_logToMSVCEnabled;

/* First 16 bits of flag */
#define OTLKCON_LOG_TARGET_NONE 0
#define OTLKCON_LOG_TARGET_ALL  1
#define OTLKCON_LOG_TARGET_MSVC 2
#define OTLKCON_LOG_TARGET_SM   4
#define OTLKCON_LOG_TARGET_FILE 8
/* Second 16 bits of flag */
#define OTLKCON_LOG_FLAG_NO_DATE    131072

int OTLKCON_LOG_PRINTF(int level, int flag, wchar_t *format, ...);
HRESULT OTLKCON_LOG_PRINT_LAST_ERROR();
HRESULT otlkcon_leaveCriticalSection( LPCRITICAL_SECTION lpcs, char *funcName  );
HRESULT otlkcon_enterCriticalSection( LPCRITICAL_SECTION lpcs, char *funcName  );
#endif /* OTLKCON_PRINT_H */